<?php
class Contact_model extends Model{

	function Contact_model(){
		parent::Model();				
	}
    
    /**
     * get list hot news in home
     * @author phuc.duong
     */
    public function saveInfo(){
    	$this->load->helper('sendEmail');
    	$data = array();
    	$data['ContactName'] = $this->input->post('ContactName');
    	$data['ContactAddress'] = $this->input->post('ContactAddress');
    	$data['ContactEmail'] = $this->input->post('ContactEmail');
    	$data['ContactPhone'] = $this->input->post('ContactPhone');
    	$data['ContactContent'] = $this->input->post('ContactContent');
    	$message = "";
    	$to = $this->session->userdata('CONFIG_COMPANY_EMAIL');
    	sendEmail($data['ContactEmail'], $to, $data['ContactName'], $data);
    	return $this->db->insert('contacts', $data); 
    }
}